Unity: Textures & Materials — How to Make a Game (Beginners)
This quick guide covers what textures and materials are, how they work with shaders, and how to wire them up in Unity (URP/Standard). Keep it open while you build.
1) Core Ideas
- Texture: an image (PNG/JPG/TGA/EXR) that stores visual data like color, bumps, metalness, etc.
- Material: a recipe that tells Unity how to draw a surface; it plugs textures into a shader.
- Shader: the math the GPU uses to render; PBR shaders (Standard/URP/HDRP) expect specific texture maps.
2) Essential PBR Texture Maps
| Map | What it Stores | Import Tips |
| Base Map / Albedo | Base color of the surface | Use sRGB (Color Texture) = ON |
| Normal Map | Small bump details for lighting | Mark as Normal map; sRGB = OFF |
| Metallic (Smoothness) | Metalness (R), Smoothness (A) | Data map; sRGB = OFF |
| Roughness | Opposite of Smoothness | Often invert to Smoothness: Smoothness = 1 − Roughness |
| Ambient Occlusion (AO) | Crevice darkening multiplier | Data map; sRGB = OFF |
| Height/Parallax | Height for parallax effects | Optional; more expensive |
| Emission | Self-glow color | sRGB = ON; enable Emission |
3) Importing Textures (Settings That Matter)
- Drag textures into the Project window.
- Select a texture and set:
- Texture Type: Color maps → Default (sRGB ON); Normal → Normal map; Data maps (metallic/roughness/ao) → Default (sRGB OFF).
- Compression: Normal quality is fine to start.
- Generate Mip Maps: ON for 3D surfaces.
- Aniso Level: Increase (2–8) for floors/walls viewed at glancing angles.
4) Make a Material & Wire Textures (URP Lit Example)
- Create → Material (e.g.,
Mat_BrickWall).
- Inspector → Shader: Universal Render Pipeline/Lit.
- Assign maps:
- Base Map: Albedo/BaseColor texture.
- Normal Map: Normal texture (apply fix prompt).
- Metallic/Smoothness: If you have Metallic (Smoothness in Alpha), use it; if you only have Roughness, invert to Smoothness first.
- AO: Assign if the shader slot is available.
- Emission: Enable Emission and assign color/map; for visible glow add Bloom in Post Processing.
- Tiling & Offset: Adjust to fit large surfaces (e.g., 2×2 or 3×3).
- Apply: Drag the material onto a mesh in the Scene view or set it in the Mesh Renderer.
5) 5‑Minute Mini Tutorial
- Create a Plane (floor) and a Cube: GameObject → 3D Object.
- Import floor textures (albedo, normal, roughness, AO).
- Create Mat_Floor (URP Lit) and assign maps as above.
- Set Tiling to repeat nicely (e.g., 3×3).
- Ensure a Directional Light exists and shadows are enabled.
- (URP) Add a Global Volume with Bloom if you use Emission.
6) Materials, Shaders, and Pipelines
- Standard (Built‑in): PBR with Metallic workflow.
- URP Lit: Efficient PBR for most platforms (great default).
- HDRP Lit: High‑end visuals (PC/console).
- Shader Graph: Visual tool for custom shaders (toon, dissolve, etc.).
7) UVs, Tiling, and Seams
- UVs tell Unity how to place textures on a mesh.
- If tiling is obvious, use seamless textures, vary tiling/offset, or blend detail maps.
- Stretched textures often mean poor UV unwrap (fix in Blender/Maya).
8) Transparency & Cutouts
- Surface Type: Opaque, Transparent, or Alpha Clipping.
- Transparent = glass/water (alpha blending). Alpha Clipping = leaves (hard edge, cheaper).
9) Performance Tips
- Use reasonable texture sizes (512–1024 for props).
- Atlas small textures to reduce draw calls.
- Share materials across objects (fewer materials = better batching).
- Enable GPU Instancing on widely reused materials.
- Use platform compression (ASTC/ETC2 mobile, DXT/BC desktop).
10) Common Pitfalls & Fixes
- Normal looks flat/weird: Mark as Normal map; sRGB OFF.
- Too shiny/dull: Smoothness wrong. If using Roughness, invert to Smoothness.
- Metal looks gray: Check albedo (metals take color from albedo) and set Metallic correctly.
- AO not visible: Correct slot and proper lighting; AO is a multiplier.
- Emission not glowing: Enable Bloom in post processing and raise intensity.
11) Tiny Script: Tweak a Material at Runtime (URP)
using UnityEngine;
public class MaterialTweaker : MonoBehaviour
{
public Renderer targetRenderer; // assign in Inspector
public Texture2D newAlbedo;
public Color tint = Color.white;
void Start()
{
var block = new MaterialPropertyBlock();
targetRenderer.GetPropertyBlock(block);
block.SetColor("_BaseColor", tint); // URP Lit color
block.SetTexture("_BaseMap", newAlbedo); // URP Lit albedo slot
block.SetFloat("_Metallic", 0.7f);
block.SetFloat("_Smoothness", 0.6f);
targetRenderer.SetPropertyBlock(block);
}
}
For Built‑in/Standard shader, use property names like _Color, _MainTex, _Metallic, _Glossiness.
12) Student Checklist
- Correct Texture Type & sRGB settings
- Normal map recognized as Normal map
- Metallic/Smoothness correct (or Roughness inverted)
- AO/Emission assigned when available
- Scene lighting ok; shadows on
- Tiling/Offset tuned on large surfaces
- (URP) Global Volume with Bloom for emission glow
- Texture sizes & compression set for target platform